package com.yang.live;

import org.bukkit.util.EulerAngle;
import org.bukkit.util.Vector;

public class VectorUtils {

    public static EulerAngle directionToEuler(Vector direction) {
        double pitch = Math.asin(-direction.getY());
        double yaw = Math.atan2(direction.getX(), direction.getZ());
        return new EulerAngle(pitch, yaw, 0);
    }
}